<script setup lang="ts">
defineOptions({
  name: 'Userlisttable',
})
interface User {
  date: string
  name: string
  address: string
  phine: string
}
const tableData: User[] = [
  {
    date: '信息科',
    name: 'xf001',
    address: '',
    phine: '13462611312',
  },
  {
    date: '信息科',
    name: 'xf002',
    address: '',
    phine: '15737310499',
  },
]
const emit = defineEmits(['handleSelec'])
const handleSelectionChange = (val: User[]) => {
  const data = {
    val: val,
    name: 'selection',
  }
  emit('handleSelec', data)
}
const clickChange = (val: User[]) => {
  const data = {
    val: val,
    name: 'click',
  }
  emit('handleSelec', data)
}
</script>

<template>
  <div>
    <el-table
      ref="multipleTableRef"
      :data="tableData"
      border
      style="width: 100%"
      @selection-change="handleSelectionChange"
      @row-dblclick="clickChange"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column label="科室名称" width="120">
        <template #default="scope">{{ scope.row.date }}</template>
      </el-table-column>
      <el-table-column property="name" label="工号" width="120" />
      <el-table-column property="address" label="姓名" />
      <el-table-column property="address" label="性别" show-overflow-tooltip />
      <el-table-column property="address" label="身份证" show-overflow-tooltip />
      <el-table-column property="phine" label="手机号" show-overflow-tooltip />
    </el-table>
  </div>
</template>

<style lang="scss" scoped></style>
